package com.wlyuan.open.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.util.List;

/**
 * @author yuanzheng
 */
@Data
public class OpenClientRegisterDTO implements Serializable {
    private static final long serialVersionUID = 6792416294989623880L;
    @NotBlank(message = "sourceKey不能为空")
    private String sourceKey;

    @ApiModelProperty("API列表")
    private List<String> apiList;

    @ApiModelProperty("名称")
    @Pattern(regexp = "^.{1,50}$", message = "最多输入50个字符")
    @NotNull(message = "名称不能为空")
    private String name;

    @ApiModelProperty("别名")
    private String alias;

    @NotBlank(message = "手机号码不能为空")
    @ApiModelProperty("手机号码")
    private String mobile;

    @ApiModelProperty("公司邮箱")
    @NotNull(message = "邮箱不能为空")
    @Pattern(regexp = "^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$", message = "请输入正确的邮箱")
    private String email;

    @ApiModelProperty("备注")
    private String remarks;

    @NotBlank(message = "营业执照编码不能为空")
    @ApiModelProperty("营业执照编码")
    @Pattern(regexp = "^[A-Za-z0-9]{1,18}", message = "只能包含大小写字母、数字，最多输入18个字符")
    private String socialCreditCode;

    @NotBlank(message = "法人不能为空")
    @ApiModelProperty("法人")
    @Pattern(regexp = "^.{1,10}$", message = "最多输入10个字符")
    private String corporation;

    @NotBlank(message = "联系人姓名不能为空")
    @ApiModelProperty("联系人姓名")
    @Pattern(regexp = "^.{1,10}$", message = "最多输入10个字符")
    private String contactName;
}
